home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / comm / tcp / ATCP_src_22.lha / AmiTCP-2.2 / src / amitcp / api / resolv.h < prev   
Encoding:
C/C++ Source or Header  |  1993-08-12  |  3.3 KB  |  87 lines

  1. /*
  2.  * Copyright (c) 1983, 1987, 1989 The Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms are permitted
  6.  * provided that: (1) source distributions retain this entire copyright
  7.  * notice and comment, and (2) distributions including binaries display
  8.  * the following acknowledgement:  ``This product includes software
  9.  * developed by the University of California, Berkeley and its contributors''
  10.  * in the documentation or other materials provided with the distribution
  11.  * and in all advertising materials mentioning features or use of this
  12.  * software. Neither the name of the University nor the names of its
  13.  * contributors may be used to endorse or promote products derived
  14.  * from this software without specific prior written permission.
  15.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  16.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  17.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  18.  *
  19.  *    @(#)resolv.h    5.10 (Berkeley) 6/1/90
  20.  */
  21.  
  22. #ifndef API_RESOLV_H
  23. #define API_RESOLV_H
  24.  
  25. /*
  26.  * Global defines and variables for resolver stub. (INSIDE AmiTCP/IP)
  27.  */
  28. #define    MAXDFLSRCH    3        /* # default domain levels to try */
  29. #define    LOCALDOMAINPARTS 2        /* min levels in name that is "local"*/
  30.  
  31. #define    RES_TIMEOUT    5        /* min. seconds between retries */
  32.  
  33. struct state {
  34.     int    retrans;         /* retransmition time interval */
  35.     int    retry;            /* number of times to retransmit */
  36.     long    options;        /* option flags - see below. */
  37.     u_short    id;            /* current packet id */
  38. };
  39.  
  40. /*
  41.  * Resolver options
  42.  */
  43. #define RES_INIT    0x0001        /* address initialized */
  44. #ifndef AMITCP /* IMPORTANT TO HAVE RES_DEBUG NOT DEFINED IF NOT DEBUGGING */
  45. #define RES_DEBUG    0x0002        /* print debug messages */
  46. #endif
  47. #define RES_AAONLY    0x0004        /* authoritative answers only */
  48. #define RES_USEVC    0x0008        /* use virtual circuit */
  49. #define RES_PRIMARY    0x0010        /* query primary server only */
  50. #define RES_IGNTC    0x0020        /* ignore trucation errors */
  51. #define RES_RECURSE    0x0040        /* recursion desired */
  52. #define RES_DEFNAMES    0x0080        /* use default domain name */
  53. #define RES_STAYOPEN    0x0100        /* Keep TCP socket open */
  54. #define RES_DNSRCH    0x0200        /* search up local domain tree */
  55.  
  56. #define RES_DEFAULT    (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
  57.  
  58. extern struct state _res;
  59. extern struct SignalSemaphore res_lock;
  60. /*
  61.  * Prototypes
  62.  */
  63. extern void res_init(void);
  64. extern int res_query(struct SocketBase *,
  65.              const char *, int, int, u_char *, int);
  66. extern int res_search(struct SocketBase *,
  67.               const char *, int, int, u_char *, int);
  68. extern int dn_expand(const u_char *, const u_char *, const u_char *, u_char *,
  69.              int);
  70. extern int dn_comp(const u_char *, u_char *, int, u_char **, u_char **);
  71. extern int __dn_skipname(const u_char *, const u_char *);
  72.  
  73. /* struct rrec; */
  74. extern int res_mkquery(int, const char *, int, int, const char *,
  75.                int, const struct rrec *, char *, int);
  76. extern int res_querydomain(struct SocketBase *, const char *, const char *,
  77.                int, int, u_char *, int);
  78. extern int res_send(struct SocketBase *, const char *, int, char *, int);
  79. extern void _res_close(struct SocketBase *);
  80.  
  81. extern u_short _getshort(u_char *);
  82. extern u_long _getlong(u_char *);
  83. extern void __putshort(u_short, u_char *);
  84. extern void __putlong(u_long, u_char *);
  85.  
  86. #endif /* API_RESOLV_H */
  87.